home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-08-10 | 41.2 KB | 912 lines | [TEXT/MPS ] |
- (*
- File: SCSI.mod
-
- Contains: SCSI Manager Interfaces.
-
- Version: Technology: System 7.5
- Package: Universal Interfaces 2.0 in “MPW Latest” on ETO #17
-
- Copyright: © 1984-1995 by Apple Computer, Inc.
- All rights reserved.
-
- Bugs?: If you find a problem with this file, use the Apple Bug Reporter
- stack. Include the file and version information (from above)
- in the problem description and send to:
- Internet: apple.bugs.applelink.apple.com
- AppleLink: APPLE.BUGS
-
- *)
-
- (*$TAGS-*)
- (*$CALLING PASCAL*)
- MODULE SCSI;
-
- IMPORT SYSTEM, Types;
-
- (* $PUSH*)
- (* $ALIGN MAC68K*)
- (* $LibExport+*)
-
- CONST
- scInc* = 1;
- scNoInc* = 2;
- scAdd* = 3;
- scMove* = 4;
- scLoop* = 5;
- scNop* = 6;
- scStop* = 7;
- scComp* = 8;
-
- (* SCSI Manager errors *)
- scCommErr* = 2; (* communications error, operation timeout *)
- scArbNBErr* = 3; (* arbitration timeout waiting for not BSY *)
- scBadParmsErr* = 4; (* bad parameter or TIB opcode *)
- scPhaseErr* = 5; (* SCSI bus not in correct phase for attempted operation *)
- scCompareErr* = 6; (* data compare error *)
- scMgrBusyErr* = 7; (* SCSI Manager busy *)
- scSequenceErr* = 8; (* attempted operation is out of sequence *)
- scBusTOErr* = 9; (* CPU bus timeout *)
- scComplPhaseErr* = 10; (* SCSI bus wasn't in Status phase *)
-
- (* Signatures *)
- sbSIGWord* = $4552; (* signature word for Block 0 ('ER') *)
- sbMac* = 1; (* system type for Mac *)
- pMapSIG* = $504D; (* partition map signature ('PM') *)
- pdSigWord* = $5453;
-
- oldPMSigWord* = pdSigWord;
- newPMSigWord* = pMapSIG;
-
- (* Driver Descriptor Map *)
-
- TYPE
- Block0* = (*ΔΔPACKEDΔΔ*) RECORD
- sbSig*: INTEGER; (* unique value for SCSI block 0 *)
- sbBlkSize*: INTEGER; (* block size of device *)
- sbBlkCount*: LONGINT; (* number of blocks on device *)
- sbDevType*: INTEGER; (* device type *)
- sbDevId*: INTEGER; (* device id *)
- sbData*: LONGINT; (* not used *)
- sbDrvrCount*: INTEGER; (* driver descriptor count *)
- ddBlock*: LONGINT; (* 1st driver's starting block *)
- ddSize*: INTEGER; (* size of 1st driver (512-byte blks) *)
- ddType*: INTEGER; (* system type (1 for Mac+) *)
- ddPad*: ARRAY 243 (*ΔΔ[0..242]ΔΔ*) OF INTEGER; (* ARRAY[0..242] OF INTEGER; not used *)
- END;
-
- (* Partition Map Entry *)
- Partition* = (*ΔΔPACKEDΔΔ*) RECORD
- pmSig*: INTEGER; (* unique value for map entry blk *)
- pmSigPad*: INTEGER; (* currently unused *)
- pmMapBlkCnt*: LONGINT; (* # of blks in partition map *)
- pmPyPartStart*: LONGINT; (* physical start blk of partition *)
- pmPartBlkCnt*: LONGINT; (* # of blks in this partition *)
- pmPartName*: (*ΔΔPACKEDΔΔ*) ARRAY 32 (*ΔΔ[0..31]ΔΔ*) OF CHAR; (* ASCII partition name *)
- pmParType*: (*ΔΔPACKEDΔΔ*) ARRAY 32 (*ΔΔ[0..31]ΔΔ*) OF CHAR; (* ASCII partition type *)
- pmLgDataStart*: LONGINT; (* log. # of partition's 1st data blk *)
- pmDataCnt*: LONGINT; (* # of blks in partition's data area *)
- pmPartStatus*: LONGINT; (* bit field for partition status *)
- pmLgBootStart*: LONGINT; (* log. blk of partition's boot code *)
- pmBootSize*: LONGINT; (* number of bytes in boot code *)
- pmBootAddr*: LONGINT; (* memory load address of boot code *)
- pmBootAddr2*: LONGINT; (* currently unused *)
- pmBootEntry*: LONGINT; (* entry point of boot code *)
- pmBootEntry2*: LONGINT; (* currently unused *)
- pmBootCksum*: LONGINT; (* checksum of boot code *)
- pmProcessor*: (*ΔΔPACKEDΔΔ*) ARRAY 16 (*ΔΔ[0..15]ΔΔ*) OF CHAR; (* ASCII for the processor type *)
- pmPad*: ARRAY 188 (*ΔΔ[0..187]ΔΔ*) OF INTEGER; (* 512 bytes long currently unused *)
- END;
-
- (* TIB instruction *)
- SCSIInstr* = RECORD
- scOpcode*: INTEGER;
- scParam1*: LONGINT;
- scParam2*: LONGINT;
- END;
-
-
- PROCEDURE SCSIReset*(): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $4267, $A815;
- (*$END*)
- PROCEDURE SCSIGet*(): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $3F3C, $0001, $A815;
- (*$END*)
- PROCEDURE SCSISelect*(targetID: INTEGER): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $3F3C, $0002, $A815;
- (*$END*)
- PROCEDURE SCSICmd*(buffer: Types.Ptr; count: INTEGER): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $3F3C, $0003, $A815;
- (*$END*)
- PROCEDURE SCSIRead*(tibPtr: Types.Ptr): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $3F3C, $0005, $A815;
- (*$END*)
- PROCEDURE SCSIRBlind*(tibPtr: Types.Ptr): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $3F3C, $0008, $A815;
- (*$END*)
- PROCEDURE SCSIWrite*(tibPtr: Types.Ptr): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $3F3C, $0006, $A815;
- (*$END*)
- PROCEDURE SCSIWBlind*(tibPtr: Types.Ptr): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $3F3C, $0009, $A815;
- (*$END*)
- PROCEDURE SCSIComplete*(VAR stat: INTEGER; VAR message: INTEGER; wait: LONGINT): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $3F3C, $0004, $A815;
- (*$END*)
- PROCEDURE SCSIStat*(): INTEGER;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $3F3C, $000A, $A815;
- (*$END*)
- PROCEDURE SCSISelAtn*(targetID: INTEGER): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $3F3C, $000B, $A815;
- (*$END*)
- PROCEDURE SCSIMsgIn*(VAR message: INTEGER): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $3F3C, $000C, $A815;
- (*$END*)
- PROCEDURE SCSIMsgOut*(message: INTEGER): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $3F3C, $000D, $A815;
- (*$END*)
- (*——————————————————————— New SCSI Manager Interface ———————————————————————*)
-
- CONST
- scsiVERSION* = 43;
-
- (* SCSI Manager function codes *)
- SCSINop* = $00; (* Execute nothing *)
- SCSIExecIO* = $01; (* Execute the specified IO *)
- SCSIBusInquiry* = $03; (* Get parameters for entire path of HBAs *)
- SCSIReleaseQ* = $04; (* Release the frozen SIM queue for particular LUN *)
- SCSIAbortCommand* = $10; (* Abort the selected Control Block *)
- SCSIResetBus* = $11; (* Reset the SCSI bus *)
- SCSIResetDevice* = $12; (* Reset the SCSI device *)
- SCSITerminateIO* = $13; (* Terminate any pending IO *)
- SCSIGetVirtualIDInfo* = $80; (* Find out which bus old AIFF.ID is on *)
- SCSILoadDriver* = $82; (* Load a driver for a device ident *)
- SCSIOldCall* = $84; (* XPT->SIM private call for old-API *)
- SCSICreateRefNumXref* = $85; (* Register a DeviceIdent to drvr RefNum xref *)
- SCSILookupRefNumXref* = $86; (* Get DeviceIdent to drvr RefNum xref *)
- SCSIRemoveRefNumXref* = $87; (* Remove a DeviceIdent to drvr RefNum xref *)
- SCSIRegisterWithNewXPT* = $88; (* XPT has changed - SIM needs to re-register itself *)
- vendorUnique* = $C0; (* 0xC0 thru 0xFF *)
-
- (* SCSI Callback Procedure Prototypes* *)
- (* SCSIInterruptPollProcPtr is obsolete (use SCSIInterruptProcPtr) but still here for compatibility *)
- TYPE
- SCSICallbackProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (scsiPB: (*ΔΔUNIVΔΔ*) Types.Ptr);
- AENCallbackProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE ;
- SIMInitProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (SIMinfoPtr: Types.Ptr): Types.OSErr;
- SIMActionProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (scsiPB: (*ΔΔUNIVΔΔ*) Types.Ptr; SIMGlobals: Types.Ptr);
- SCSIProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE ;
- SCSIMakeCallbackProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (scsiPB: (*ΔΔUNIVΔΔ*) Types.Ptr);
- SCSIInterruptPollProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (SIMGlobals: Types.Ptr): LONGINT;
- SCSIInterruptProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (SIMGlobals: Types.Ptr): LONGINT;
- SCSICallbackUPP* = Types.UniversalProcPtr;
- AENCallbackUPP* = Types.UniversalProcPtr;
- SIMInitUPP* = Types.UniversalProcPtr;
- SIMActionUPP* = Types.UniversalProcPtr;
- SCSIUPP* = Types.UniversalProcPtr;
- SCSIMakeCallbackUPP* = Types.UniversalProcPtr;
- SCSIInterruptPollUPP* = Types.UniversalProcPtr;
- SCSIInterruptUPP* = Types.UniversalProcPtr;
-
- CONST
- uppSCSICallbackProcInfo* = $000000C0; (* PROCEDURE (4 byte param); *)
- uppAENCallbackProcInfo* = $00000001; (* PROCEDURE ; *)
- uppSIMInitProcInfo* = $000000E1; (* PROCEDURE (4 byte param): 2 byte result; *)
- uppSIMActionProcInfo* = $000003C1; (* PROCEDURE (4 byte param, 4 byte param); *)
- uppSCSIProcInfo* = $00000001; (* PROCEDURE ; *)
- uppSCSIMakeCallbackProcInfo* = $000000C1; (* PROCEDURE (4 byte param); *)
- uppSCSIInterruptPollProcInfo* = $000000F1; (* PROCEDURE (4 byte param): 4 byte result; *)
- uppSCSIInterruptProcInfo* = $000000F1; (* PROCEDURE (4 byte param): 4 byte result; *)
-
- PROCEDURE NewSCSICallbackProc*(userRoutine: SCSICallbackProcPtr): SCSICallbackUPP;
- (*$IF NOT GENERATINGCFM *)
- INLINE PASCAL $2E9F;
- (*$END*)
-
- PROCEDURE NewAENCallbackProc*(userRoutine: AENCallbackProcPtr): AENCallbackUPP;
- (*$IF NOT GENERATINGCFM *)
- INLINE PASCAL $2E9F;
- (*$END*)
-
- PROCEDURE NewSIMInitProc*(userRoutine: SIMInitProcPtr): SIMInitUPP;
- (*$IF NOT GENERATINGCFM *)
- INLINE PASCAL $2E9F;
- (*$END*)
-
- PROCEDURE NewSIMActionProc*(userRoutine: SIMActionProcPtr): SIMActionUPP;
- (*$IF NOT GENERATINGCFM *)
- INLINE PASCAL $2E9F;
- (*$END*)
-
- PROCEDURE NewSCSIProc*(userRoutine: SCSIProcPtr): SCSIUPP;
- (*$IF NOT GENERATINGCFM *)
- INLINE PASCAL $2E9F;
- (*$END*)
-
- PROCEDURE NewSCSIMakeCallbackProc*(userRoutine: SCSIMakeCallbackProcPtr): SCSIMakeCallbackUPP;
- (*$IF NOT GENERATINGCFM *)
- INLINE PASCAL $2E9F;
- (*$END*)
-
- PROCEDURE NewSCSIInterruptPollProc*(userRoutine: SCSIInterruptPollProcPtr): SCSIInterruptPollUPP;
- (*$IF NOT GENERATINGCFM *)
- INLINE PASCAL $2E9F;
- (*$END*)
-
- PROCEDURE NewSCSIInterruptProc*(userRoutine: SCSIInterruptProcPtr): SCSIInterruptUPP;
- (*$IF NOT GENERATINGCFM *)
- INLINE PASCAL $2E9F;
- (*$END*)
-
- PROCEDURE CallSCSICallbackProc*(scsiPB: (*ΔΔUNIVΔΔ*) Types.Ptr; userRoutine: SCSICallbackUPP);
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $4E90;
- (*$END*)
-
- PROCEDURE CallAENCallbackProc*(userRoutine: AENCallbackUPP);
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $4E90;
- (*$END*)
-
- PROCEDURE CallSIMInitProc*(SIMinfoPtr: Types.Ptr; userRoutine: SIMInitUPP): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $4E90;
- (*$END*)
-
- PROCEDURE CallSIMActionProc*(scsiPB: (*ΔΔUNIVΔΔ*) Types.Ptr; SIMGlobals: Types.Ptr; userRoutine: SIMActionUPP);
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $4E90;
- (*$END*)
-
- PROCEDURE CallSCSIProc*(userRoutine: SCSIUPP);
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $4E90;
- (*$END*)
-
- PROCEDURE CallSCSIMakeCallbackProc*(scsiPB: (*ΔΔUNIVΔΔ*) Types.Ptr; userRoutine: SCSIMakeCallbackUPP);
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $4E90;
- (*$END*)
-
- PROCEDURE CallSCSIInterruptPollProc*(SIMGlobals: Types.Ptr; userRoutine: SCSIInterruptPollUPP): LONGINT;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $4E90;
- (*$END*)
-
- PROCEDURE CallSCSIInterruptProc*(SIMGlobals: Types.Ptr; userRoutine: SCSIInterruptUPP): LONGINT;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $4E90;
- (*$END*)
-
- CONST
- handshakeDataLength* = 8; (* Handshake data length *)
- maxCDBLength* = 16; (* Space for the CDB bytes/pointer *)
- vendorIDLength* = 16; (* ASCII string len for Vendor AIFF.ID *)
-
- (* Define DeviceIdent structure *)
-
- TYPE
- DeviceIdent* = (*ΔΔPACKEDΔΔ*) RECORD
- diReserved*: Types.UInt8; (* reserved *)
- bus*: Types.UInt8; (* SCSI - Bus Number *)
- targetID*: Types.UInt8; (* SCSI - Target SCSI AIFF.ID *)
- LUN*: Types.UInt8; (* SCSI - LUN *)
- END;
-
- (* Command Descriptor Block structure *)
- CDB* = ARRAY (*ΔΔ[0..*)maxCDBLength(*ΔΔ -1]ΔΔ*) OF Types.UInt8;
-
- SGRecord* = RECORD
- SGAddr*: Types.Ptr;
- SGCount*: Types.UInt32;
- END;
-
- (* SCSI Phases (used by SIMs to support the Original SCSI Manager *)
-
- CONST
- kDataOutPhase* = 0; (* Encoded MSG, C/D, I/O bits *)
- kDataInPhase* = 1;
- kCommandPhase* = 2;
- kStatusPhase* = 3;
- kPhaseIllegal0* = 4;
- kPhaseIllegal1* = 5;
- kMessageOutPhase* = 6;
- kMessageInPhase* = 7;
- kBusFreePhase* = 8; (* Additional Phases *)
- kArbitratePhase* = 9;
- kSelectPhase* = 10;
- kMessageInPhaseNACK* = 11; (* Message In Phase with ACK hanging on the bus *)
-
-
- TYPE
- SCSIHdrPtr* = POINTER TO SCSIHdr;
- SCSIHdr* = RECORD
- qLink*: SCSIHdrPtr (*ΔΔ POINTER TO SCSIHdr*);
- scsiReserved1*: INTEGER;
- scsiPBLength*: Types.UInt16;
- scsiFunctionCode*: Types.SInt8; (* UInt8 *)
- scsiReserved2*: Types.SInt8; (* UInt8 *)
- scsiResult*: Types.OSErr;
- scsiDevice*: DeviceIdent;
- scsiCompletion*: SCSICallbackUPP;
- scsiFlags*: Types.UInt32;
- scsiDriverStorage*: SYSTEM.PTR (*ΔΔ POINTER TO UInt8*);
- scsiXPTprivate*: Types.Ptr;
- scsiReserved3*: LONGINT;
- END;
-
- SCSI_PB* = RECORD
- qLink*: POINTER TO SCSIHdr;
- scsiReserved1*: INTEGER;
- scsiPBLength*: Types.UInt16;
- scsiFunctionCode*: Types.SInt8; (* UInt8 *)
- scsiReserved2*: Types.SInt8; (* UInt8 *)
- scsiResult*: Types.OSErr;
- scsiDevice*: DeviceIdent;
- scsiCompletion*: SCSICallbackUPP;
- scsiFlags*: Types.UInt32;
- scsiDriverStorage*: SYSTEM.PTR (*ΔΔ POINTER TO UInt8*);
- scsiXPTprivate*: Types.Ptr;
- scsiReserved3*: LONGINT;
- END;
-
- SCSI_IOPtr* = POINTER TO SCSI_IO;
- SCSI_IO* = RECORD
- qLink*: POINTER TO SCSIHdr;
- scsiReserved1*: INTEGER;
- scsiPBLength*: Types.UInt16;
- scsiFunctionCode*: Types.SInt8; (* UInt8 *)
- scsiReserved2*: Types.SInt8; (* UInt8 *)
- scsiResult*: Types.OSErr;
- scsiDevice*: DeviceIdent;
- scsiCompletion*: SCSICallbackUPP;
- scsiFlags*: Types.UInt32;
- scsiDriverStorage*: SYSTEM.PTR (*ΔΔ POINTER TO UInt8*);
- scsiXPTprivate*: Types.Ptr;
- scsiReserved3*: LONGINT;
- scsiResultFlags*: Types.UInt16;
- scsiReserved3pt5*: Types.UInt16;
- scsiDataPtr*: SYSTEM.PTR (*ΔΔ POINTER TO UInt8*);
- scsiDataLength*: Types.UInt32;
- scsiSensePtr*: SYSTEM.PTR (*ΔΔ POINTER TO UInt8*);
- scsiSenseLength*: Types.SInt8; (* UInt8 *)
- scsiCDBLength*: Types.SInt8; (* UInt8 *)
- scsiSGListCount*: Types.UInt16;
- scsiReserved4*: Types.UInt32;
- scsiSCSIstatus*: Types.SInt8; (* UInt8 *)
- scsiSenseResidual*: Types.SInt8;
- scsiReserved5*: Types.UInt16;
- scsiDataResidual*: LONGINT;
- scsiCDB*: CDB;
- scsiTimeout*: LONGINT;
- scsiReserved5pt5*: SYSTEM.PTR (*ΔΔ POINTER TO UInt8*);
- scsiReserved5pt6*: Types.UInt16;
- scsiIOFlags*: Types.UInt16;
- scsiTagAction*: Types.SInt8; (* UInt8 *)
- scsiReserved6*: Types.SInt8; (* UInt8 *)
- scsiReserved7*: Types.UInt16;
- scsiSelectTimeout*: Types.UInt16;
- scsiDataType*: Types.SInt8; (* UInt8 *)
- scsiTransferType*: Types.SInt8; (* UInt8 *)
- scsiReserved8*: Types.UInt32;
- scsiReserved9*: Types.UInt32;
- scsiHandshake*: ARRAY (*ΔΔ[0..*)handshakeDataLength(*ΔΔ -1]ΔΔ*) OF Types.UInt16;
- scsiReserved10*: Types.UInt32;
- scsiReserved11*: Types.UInt32;
- scsiCommandLink*: SCSI_IOPtr (*ΔΔ POINTER TO SCSI_IO*);
- scsiSIMpublics*: ARRAY 8 (*ΔΔ[0..7]ΔΔ*) OF Types.SInt8; (* UInt8 *)
- scsiAppleReserved6*: ARRAY 8 (*ΔΔ[0..7]ΔΔ*) OF Types.SInt8; (* UInt8 *)
- scsiCurrentPhase*: Types.UInt16;
- scsiSelector*: INTEGER;
- scsiOldCallResult*: Types.OSErr;
- scsiSCSImessage*: Types.SInt8; (* UInt8 *)
- XPTprivateFlags*: Types.SInt8; (* UInt8 *)
- XPTextras*: ARRAY 12 (*ΔΔ[0..11]ΔΔ*) OF Types.SInt8; (* UInt8 *)
- END;
-
- SCSIExecIOPB* = SCSI_IO;
-
- (* Bus inquiry PB *)
- SCSIBusInquiryPB* = RECORD
- qLink*: POINTER TO SCSIHdr;
- scsiReserved1*: INTEGER;
- scsiPBLength*: Types.UInt16;
- scsiFunctionCode*: Types.SInt8; (* UInt8 *)
- scsiReserved2*: Types.SInt8; (* UInt8 *)
- scsiResult*: Types.OSErr;
- scsiDevice*: DeviceIdent;
- scsiCompletion*: SCSICallbackUPP;
- scsiFlags*: Types.UInt32;
- scsiDriverStorage*: SYSTEM.PTR (*ΔΔ POINTER TO UInt8*);
- scsiXPTprivate*: Types.Ptr;
- scsiReserved3*: LONGINT;
- scsiEngineCount*: Types.UInt16; (* <- Number of engines on HBA *)
- scsiMaxTransferType*: Types.UInt16; (* <- Number of transfer types for this HBA *)
- scsiDataTypes*: Types.UInt32; (* <- which data types are supported by this SIM *)
- scsiIOpbSize*: Types.UInt16; (* <- Memory.Size of SCSI_IO PB for this SIM/HBA *)
- scsiMaxIOpbSize*: Types.UInt16; (* <- Memory.Size of max SCSI_IO PB for all SIM/HBAs *)
- scsiFeatureFlags*: Types.UInt32; (* <- Supported features flags field *)
- scsiVersionNumber*: Types.SInt8; (* UInt8 *) (* <- Version number for the SIM/HBA *)
- scsiHBAInquiry*: Types.SInt8; (* UInt8 *) (* <- Mimic of INQ byte 7 for the HBA *)
- scsiTargetModeFlags*: Types.SInt8; (* UInt8 *) (* <- Flags for target mode support *)
- scsiScanFlags*: Types.SInt8; (* UInt8 *) (* <- Scan related feature flags *)
- scsiSIMPrivatesPtr*: Types.UInt32; (* <- Types.Ptr to SIM private data area *)
- scsiSIMPrivatesSize*: Types.UInt32; (* <- Memory.Size of SIM private data area *)
- scsiAsyncFlags*: Types.UInt32; (* <- Event cap. for Async Callback *)
- scsiHiBusID*: Types.SInt8; (* UInt8 *) (* <- Highest path AIFF.ID in the subsystem *)
- scsiInitiatorID*: Types.SInt8; (* UInt8 *) (* <- AIFF.ID of the HBA on the SCSI bus *)
- scsiBIReserved0*: Types.UInt16; (* *)
- scsiBIReserved1*: Types.UInt32; (* <- *)
- scsiFlagsSupported*: Types.UInt32; (* <- which scsiFlags are supported *)
- scsiIOFlagsSupported*: Types.UInt16; (* <- which scsiIOFlags are supported *)
- scsiWeirdStuff*: Types.UInt16; (* <- *)
- scsiMaxTarget*: Types.UInt16; (* <- maximum Target number supported *)
- scsiMaxLUN*: Types.UInt16; (* <- maximum Logical Unit number supported *)
- scsiSIMVendor*: (*ΔΔPACKEDΔΔ*) ARRAY (*ΔΔ[0..*)vendorIDLength(*ΔΔ -1]ΔΔ*) OF CHAR; (* <- Vendor AIFF.ID of SIM (or XPT if bus<FF) *)
- scsiHBAVendor*: (*ΔΔPACKEDΔΔ*) ARRAY (*ΔΔ[0..*)vendorIDLength(*ΔΔ -1]ΔΔ*) OF CHAR; (* <- Vendor AIFF.ID of the HBA *)
- scsiControllerFamily*: (*ΔΔPACKEDΔΔ*) ARRAY (*ΔΔ[0..*)vendorIDLength(*ΔΔ -1]ΔΔ*) OF CHAR; (* <- Family of SCSI Controller *)
- scsiControllerType*: (*ΔΔPACKEDΔΔ*) ARRAY (*ΔΔ[0..*)vendorIDLength(*ΔΔ -1]ΔΔ*) OF CHAR; (* <- Specific Model of SCSI Controller used *)
- scsiXPTversion*: (*ΔΔPACKEDΔΔ*) ARRAY 4 (*ΔΔ[0..3]ΔΔ*) OF CHAR; (* <- version number of XPT *)
- scsiSIMversion*: (*ΔΔPACKEDΔΔ*) ARRAY 4 (*ΔΔ[0..3]ΔΔ*) OF CHAR; (* <- version number of SIM *)
- scsiHBAversion*: (*ΔΔPACKEDΔΔ*) ARRAY 4 (*ΔΔ[0..3]ΔΔ*) OF CHAR; (* <- version number of HBA *)
- scsiHBAslotType*: Types.SInt8; (* UInt8 *) (* <- type of "slot" that this HBA is in *)
- scsiHBAslotNumber*: Types.SInt8; (* UInt8 *) (* <- slot number of this HBA *)
- scsiSIMsRsrcID*: Types.UInt16; (* <- resource AIFF.ID of this SIM *)
- scsiBIReserved3*: Types.UInt16; (* <- *)
- scsiAdditionalLength*: Types.UInt16; (* <- additional BusInquiry PB len *)
- END;
-
- (* Abort SIM Request PB *)
- SCSIAbortCommandPB* = RECORD
- qLink*: POINTER TO SCSIHdr;
- scsiReserved1*: INTEGER;
- scsiPBLength*: Types.UInt16;
- scsiFunctionCode*: Types.SInt8; (* UInt8 *)
- scsiReserved2*: Types.SInt8; (* UInt8 *)
- scsiResult*: Types.OSErr;
- scsiDevice*: DeviceIdent;
- scsiCompletion*: SCSICallbackUPP;
- scsiFlags*: Types.UInt32;
- scsiDriverStorage*: SYSTEM.PTR (*ΔΔ POINTER TO UInt8*);
- scsiXPTprivate*: Types.Ptr;
- scsiReserved3*: LONGINT;
- scsiIOptr*: SYSTEM.PTR (*ΔΔ POINTER TO SCSI_IO*); (* Pointer to the PB to abort *)
- END;
-
- (* Terminate I/O Process Request PB *)
- SCSITerminateIOPB* = RECORD
- qLink*: POINTER TO SCSIHdr;
- scsiReserved1*: INTEGER;
- scsiPBLength*: Types.UInt16;
- scsiFunctionCode*: Types.SInt8; (* UInt8 *)
- scsiReserved2*: Types.SInt8; (* UInt8 *)
- scsiResult*: Types.OSErr;
- scsiDevice*: DeviceIdent;
- scsiCompletion*: SCSICallbackUPP;
- scsiFlags*: Types.UInt32;
- scsiDriverStorage*: SYSTEM.PTR (*ΔΔ POINTER TO UInt8*);
- scsiXPTprivate*: Types.Ptr;
- scsiReserved3*: LONGINT;
- scsiIOptr*: POINTER TO SCSI_IO; (* Pointer to the PB to terminate *)
- END;
-
- (* Reset SCSI Bus PB *)
- SCSIResetBusPB* = RECORD
- qLink*: POINTER TO SCSIHdr;
- scsiReserved1*: INTEGER;
- scsiPBLength*: Types.UInt16;
- scsiFunctionCode*: Types.SInt8; (* UInt8 *)
- scsiReserved2*: Types.SInt8; (* UInt8 *)
- scsiResult*: Types.OSErr;
- scsiDevice*: DeviceIdent;
- scsiCompletion*: SCSICallbackUPP;
- scsiFlags*: Types.UInt32;
- scsiDriverStorage*: SYSTEM.PTR (*ΔΔ POINTER TO UInt8*);
- scsiXPTprivate*: Types.Ptr;
- scsiReserved3*: LONGINT;
- END;
-
- (* Reset SCSI Device PB *)
- SCSIResetDevicePB* = RECORD
- qLink*: POINTER TO SCSIHdr;
- scsiReserved1*: INTEGER;
- scsiPBLength*: Types.UInt16;
- scsiFunctionCode*: Types.SInt8; (* UInt8 *)
- scsiReserved2*: Types.SInt8; (* UInt8 *)
- scsiResult*: Types.OSErr;
- scsiDevice*: DeviceIdent;
- scsiCompletion*: SCSICallbackUPP;
- scsiFlags*: Types.UInt32;
- scsiDriverStorage*: SYSTEM.PTR (*ΔΔ POINTER TO UInt8*);
- scsiXPTprivate*: Types.Ptr;
- scsiReserved3*: LONGINT;
- END;
-
- (* Release SIM Queue PB *)
- SCSIReleaseQPB* = RECORD
- qLink*: POINTER TO SCSIHdr;
- scsiReserved1*: INTEGER;
- scsiPBLength*: Types.UInt16;
- scsiFunctionCode*: Types.SInt8; (* UInt8 *)
- scsiReserved2*: Types.SInt8; (* UInt8 *)
- scsiResult*: Types.OSErr;
- scsiDevice*: DeviceIdent;
- scsiCompletion*: SCSICallbackUPP;
- scsiFlags*: Types.UInt32;
- scsiDriverStorage*: SYSTEM.PTR (*ΔΔ POINTER TO UInt8*);
- scsiXPTprivate*: Types.Ptr;
- scsiReserved3*: LONGINT;
- END;
-
- (* SCSI Get Virtual AIFF.ID Info PB *)
- SCSIGetVirtualIDInfoPB* = RECORD
- qLink*: POINTER TO SCSIHdr;
- scsiReserved1*: INTEGER;
- scsiPBLength*: Types.UInt16;
- scsiFunctionCode*: Types.SInt8; (* UInt8 *)
- scsiReserved2*: Types.SInt8; (* UInt8 *)
- scsiResult*: Types.OSErr;
- scsiDevice*: DeviceIdent;
- scsiCompletion*: SCSICallbackUPP;
- scsiFlags*: Types.UInt32;
- scsiDriverStorage*: SYSTEM.PTR (*ΔΔ POINTER TO UInt8*);
- scsiXPTprivate*: Types.Ptr;
- scsiReserved3*: LONGINT;
- scsiOldCallID*: Types.UInt16; (* -> SCSI AIFF.ID of device in question *)
- scsiExists*: BOOLEAN; (* <- true if device exists *)
- END;
-
- (* Create/Lookup/Remove RefNum for Device PB *)
- SCSIDriverPB* = RECORD
- qLink*: POINTER TO SCSIHdr;
- scsiReserved1*: INTEGER;
- scsiPBLength*: Types.UInt16;
- scsiFunctionCode*: Types.SInt8; (* UInt8 *)
- scsiReserved2*: Types.SInt8; (* UInt8 *)
- scsiResult*: Types.OSErr;
- scsiDevice*: DeviceIdent;
- scsiCompletion*: SCSICallbackUPP;
- scsiFlags*: Types.UInt32;
- scsiDriverStorage*: SYSTEM.PTR (*ΔΔ POINTER TO UInt8*);
- scsiXPTprivate*: Types.Ptr;
- scsiReserved3*: LONGINT;
- scsiDriver*: INTEGER; (* -> DriverRefNum, For SetDriver, <- For GetNextDriver *)
- scsiDriverFlags*: Types.UInt16; (* <> Details of driver/device *)
- scsiNextDevice*: DeviceIdent; (* <- DeviceIdent of the NEXT Item in the list *)
- END;
-
- (* Load Driver PB *)
- SCSILoadDriverPB* = RECORD
- qLink*: POINTER TO SCSIHdr;
- scsiReserved1*: INTEGER;
- scsiPBLength*: Types.UInt16;
- scsiFunctionCode*: Types.SInt8; (* UInt8 *)
- scsiReserved2*: Types.SInt8; (* UInt8 *)
- scsiResult*: Types.OSErr;
- scsiDevice*: DeviceIdent;
- scsiCompletion*: SCSICallbackUPP;
- scsiFlags*: Types.UInt32;
- scsiDriverStorage*: SYSTEM.PTR (*ΔΔ POINTER TO UInt8*);
- scsiXPTprivate*: Types.Ptr;
- scsiReserved3*: LONGINT;
- scsiLoadedRefNum*: INTEGER; (* <- SIM returns refnum of driver *)
- scsiDiskLoadFailed*: BOOLEAN; (* -> if true, indicates call after failure to load *)
- END;
-
- (* Defines for the scsiTransferType field *)
-
- CONST
- scsiTransferBlind* = 0;
- scsiTransferPolled* = 1;
-
- (* Defines for the scsiDataType field *)
- scsiDataBuffer* = 0; (* single contiguous buffer supplied *)
- scsiDataTIB* = 1; (* TIB supplied (ptr in scsiDataPtr) *)
- scsiDataSG* = 2; (* scatter/gather list supplied *)
-
- (* Defines for the SCSIMgr scsiResult field in the PB header. *)
- (* $E100 thru E1FF *)
- (* -$1EFF thru -1E00 *)
- (* -#7935 thru -7681 *)
- (** = 0xE100 *)
- scsiErrorBase* = -7936;
-
- scsiRequestInProgress* = 1; (* 1* = PB request is in progress *)
- (* Execution failed 00-2F *)
- scsiRequestAborted* = scsiErrorBase + 2; (* -7934* = PB request aborted by the host *)
- scsiUnableToAbort* = scsiErrorBase + 3; (* -7933* = Unable to Abort PB request *)
- scsiNonZeroStatus* = scsiErrorBase + 4; (* -7932* = PB request completed with an err *)
- scsiUnused05* = scsiErrorBase + 5; (* -7931* = *)
- scsiUnused06* = scsiErrorBase + 6; (* -7930* = *)
- scsiUnused07* = scsiErrorBase + 7; (* -7929* = *)
- scsiUnused08* = scsiErrorBase + 8; (* -7928* = *)
- scsiUnableToTerminate* = scsiErrorBase + 9; (* -7927* = Unable to Terminate I/O PB req *)
- scsiSelectTimeout* = scsiErrorBase + 10; (* -7926* = Target selection timeout *)
- scsiCommandTimeout* = scsiErrorBase + 11; (* -7925* = Command timeout *)
- scsiIdentifyMessageRejected* = scsiErrorBase + 12; (* -7924* = *)
- scsiMessageRejectReceived* = scsiErrorBase + 13; (* -7923* = Message reject received *)
- scsiSCSIBusReset* = scsiErrorBase + 14; (* -7922* = SCSI bus reset sent/received *)
- scsiParityError* = scsiErrorBase + 15; (* -7921* = Uncorrectable parity error occured *)
- scsiAutosenseFailed* = scsiErrorBase + 16; (* -7920* = Autosense*: Request sense cmd fail *)
- scsiUnused11* = scsiErrorBase + 17; (* -7919* = *)
- scsiDataRunError* = scsiErrorBase + 18; (* -7918* = Data overrun/underrun error *)
- scsiUnexpectedBusFree* = scsiErrorBase + 19; (* -7917* = Unexpected BUS free *)
- scsiSequenceFailed* = scsiErrorBase + 20; (* -7916* = Target bus phase sequence failure *)
- scsiWrongDirection* = scsiErrorBase + 21; (* -7915* = Data phase was in wrong direction *)
- scsiUnused16* = scsiErrorBase + 22; (* -7914* = *)
- scsiBDRsent* = scsiErrorBase + 23; (* -7913* = A SCSI BDR msg was sent to target *)
- scsiTerminated* = scsiErrorBase + 24; (* -7912* = PB request terminated by the host *)
- scsiNoNexus* = scsiErrorBase + 25; (* -7911* = Nexus is not established *)
- scsiCDBReceived* = scsiErrorBase + 26; (* -7910* = The SCSI CDB has been received *)
- (* Couldn't begin execution 30-3F *)
- scsiTooManyBuses* = scsiErrorBase + 48; (* -7888* = Register failed because we're full *)
- scsiBusy* = scsiErrorBase + 49; (* -7887* = SCSI subsystem is busy *)
- scsiProvideFail* = scsiErrorBase + 50; (* -7886* = Unable to provide requ. capability *)
- scsiDeviceNotThere* = scsiErrorBase + 51; (* -7885* = SCSI device not installed/there *)
- scsiNoHBA* = scsiErrorBase + 52; (* -7884* = No HBA detected Error *)
- scsiDeviceConflict* = scsiErrorBase + 53; (* -7883* = sorry, max 1 refNum per DeviceIdent *)
- scsiNoSuchXref* = scsiErrorBase + 54; (* -7882* = no such RefNum xref *)
- scsiQLinkInvalid* = scsiErrorBase + 55; (* -7881* = pre-linked PBs not supported
- (The QLink field was nonzero) *)
- (* Parameter errors 40-7F *)
- scsiPBLengthError* = scsiErrorBase + 64; (* -7872* = (scsiPBLength is insuf'ct/invalid *)
- scsiFunctionNotAvailable* = scsiErrorBase + 65; (* -7871* = The requ. func is not available *)
- scsiRequestInvalid* = scsiErrorBase + 66; (* -7870* = PB request is invalid *)
- scsiBusInvalid* = scsiErrorBase + 67; (* -7869* = Bus AIFF.ID supplied is invalid *)
- scsiTIDInvalid* = scsiErrorBase + 68; (* -7868* = Target AIFF.ID supplied is invalid *)
- scsiLUNInvalid* = scsiErrorBase + 69; (* -7867* = LUN supplied is invalid *)
- scsiIDInvalid* = scsiErrorBase + 70; (* -7866* = The initiator AIFF.ID is invalid *)
- scsiDataTypeInvalid* = scsiErrorBase + 71; (* -7865* = scsiDataType requested not supported *)
- scsiTransferTypeInvalid* = scsiErrorBase + 72; (* -7864* = scsiTransferType field is too high *)
- scsiCDBLengthInvalid* = scsiErrorBase + 73; (* -7863* = scsiCDBLength field is too big *)
-
- scsiExecutionErrors* = scsiErrorBase;
- scsiNotExecutedErrors* = scsiTooManyBuses;
- scsiParameterErrors* = scsiPBLengthError;
-
- (* Defines for the scsiResultFlags field *)
- scsiSIMQFrozen* = $0001; (* The SIM queue is frozen w/this err *)
- scsiAutosenseValid* = $0002; (* Autosense data valid for target *)
- scsiBusNotFree* = $0004; (* At time of callback, SCSI bus is not free *)
-
- (* Defines for the bit numbers of the scsiFlags field in the PB header for the SCSIExecIO function *)
- kbSCSIDisableAutosense* = 29; (* Disable auto sense feature *)
- kbSCSIFlagReservedA* = 28; (* *)
- kbSCSIFlagReserved0* = 27; (* *)
- kbSCSICDBLinked* = 26; (* The PB contains a linked CDB *)
- kbSCSIQEnable* = 25; (* Target queue actions are enabled *)
- kbSCSICDBIsPointer* = 24; (* The CDB field contains a pointer *)
- kbSCSIFlagReserved1* = 23; (* *)
- kbSCSIInitiateSyncData* = 22; (* Attempt Sync data xfer and SDTR *)
- kbSCSIDisableSyncData* = 21; (* Disable sync, go to async *)
- kbSCSISIMQHead* = 20; (* Place PB at the head of SIM Q *)
- kbSCSISIMQFreeze* = 19; (* Return the SIM Q to frozen state *)
- kbSCSISIMQNoFreeze* = 18; (* Disallow SIM Q freezing *)
- kbSCSIDoDisconnect* = 17; (* Definitely do disconnect *)
- kbSCSIDontDisconnect* = 16; (* Definitely don't disconnect *)
- kbSCSIDataReadyForDMA* = 15; (* Data buffer(s) are ready for DMA *)
- kbSCSIFlagReserved3* = 14; (* *)
- kbSCSIDataPhysical* = 13; (* SG/Buffer data ptrs are physical *)
- kbSCSISensePhysical* = 12; (* Autosense buffer ptr is physical *)
- kbSCSIFlagReserved5* = 11; (* *)
- kbSCSIFlagReserved6* = 10; (* *)
- kbSCSIFlagReserved7* = 9; (* *)
- kbSCSIFlagReserved8* = 8; (* *)
- kbSCSIDataBufferValid* = 7; (* Data buffer valid *)
- kbSCSIStatusBufferValid* = 6; (* Status buffer valid *)
- kbSCSIMessageBufferValid* = 5; (* Message buffer valid *)
- kbSCSIFlagReserved9* = 4; (* *)
-
- (* Defines for the bit masks of the scsiFlags field *)
- scsiDirectionMask* = $C0000000; (* Data direction mask *)
- scsiDirectionNone* = $C0000000; (* Data direction (11: no data) *)
- scsiDirectionReserved* = $00000000; (* Data direction (00: reserved) *)
- scsiDirectionOut* = $80000000; (* Data direction (10: DATA OUT) *)
- scsiDirectionIn* = $40000000; (* Data direction (01: DATA IN) *)
- scsiDisableAutosense* = $20000000; (* Disable auto sense feature *)
- scsiFlagReservedA* = $10000000; (* *)
- scsiFlagReserved0* = $08000000; (* *)
- scsiCDBLinked* = $04000000; (* The PB contains a linked CDB *)
- scsiQEnable* = $02000000; (* Target queue actions are enabled *)
- scsiCDBIsPointer* = $01000000; (* The CDB field contains a pointer *)
- scsiFlagReserved1* = $00800000; (* *)
- scsiInitiateSyncData* = $00400000; (* Attempt Sync data xfer and SDTR *)
- scsiDisableSyncData* = $00200000; (* Disable sync, go to async *)
- scsiSIMQHead* = $00100000; (* Place PB at the head of SIM Q *)
- scsiSIMQFreeze* = $00080000; (* Return the SIM Q to frozen state *)
- scsiSIMQNoFreeze* = $00040000; (* Disallow SIM Q freezing *)
- scsiDoDisconnect* = $00020000; (* Definitely do disconnect *)
- scsiDontDisconnect* = $00010000; (* Definitely don't disconnect *)
- scsiDataReadyForDMA* = $00008000; (* Data buffer(s) are ready for DMA *)
- scsiFlagReserved3* = $00004000; (* *)
- scsiDataPhysical* = $00002000; (* SG/Buffer data ptrs are physical *)
- scsiSensePhysical* = $00001000; (* Autosense buffer ptr is physical *)
- scsiFlagReserved5* = $00000800; (* *)
- scsiFlagReserved6* = $00000400; (* *)
- scsiFlagReserved7* = $00000200; (* *)
- scsiFlagReserved8* = $00000100; (* *)
-
- (* bit masks for the scsiIOFlags field in SCSIExecIOPB *)
- scsiNoParityCheck* = $0002; (* disable parity checking *)
- scsiDisableSelectWAtn* = $0004; (* disable select w/Atn *)
- scsiSavePtrOnDisconnect* = $0008; (* do SaveDataPointer upon Disconnect msg *)
- scsiNoBucketIn* = $0010; (* don’t bit bucket in during this I/O *)
- scsiNoBucketOut* = $0020; (* don’t bit bucket out during this I/O *)
- scsiDisableWide* = $0040; (* disable wide transfer negotiation *)
- scsiInitiateWide* = $0080; (* initiate wide transfer negotiation *)
- scsiRenegotiateSense* = $0100; (* renegotiate sync/wide before issuing autosense *)
- scsiDisableDiscipline* = $0200; (* disable parameter checking on SCSIExecIO calls *)
- scsiIOFlagReserved0080* = $0080; (* *)
- scsiIOFlagReserved8000* = $8000; (* *)
-
- (* Defines for the SIM/HBA queue actions. These values are used in the *)
- (* SCSIExecIOPB, for the queue action field. [These values should match the *)
- (* defines from some other include file for the SCSI message phases. We may *)
- (* not need these definitions here. ] *)
- scsiSimpleQTag* = $20; (* Tag for a simple queue *)
- scsiHeadQTag* = $21; (* Tag for head of queue *)
- scsiOrderedQTag* = $22; (* Tag for ordered queue *)
-
- (* Defines for the Bus Inquiry PB fields. *)
- (* scsiHBAInquiry field bits *)
- scsiBusMDP* = $80; (* Supports Modify Data Pointer message *)
- scsiBusWide32* = $40; (* Supports 32 bit wide SCSI *)
- scsiBusWide16* = $20; (* Supports 16 bit wide SCSI *)
- scsiBusSDTR* = $10; (* Supports Sync Data Transfer Req message *)
- scsiBusLinkedCDB* = $08; (* Supports linked CDBs *)
- scsiBusTagQ* = $02; (* Supports tag queue message *)
- scsiBusSoftReset* = $01; (* Supports soft reset *)
-
- (* scsiDataTypes field bits *)
- (* bits 0->15 Apple-defined, 16->30 3rd-party unique, 31* = reserved *)
- scsiBusDataTIB* = ASH(1,scsiDataTIB); (* TIB supplied (ptr in scsiDataPtr) *)
- scsiBusDataBuffer* = ASH(1,scsiDataBuffer); (* single contiguous buffer supplied *)
- scsiBusDataSG* = ASH(1,scsiDataSG); (* scatter/gather list supplied *)
- scsiBusDataReserved* = $80000000; (* *)
-
- (* scsiScanFlags field bits *)
- scsiBusScansDevices* = $80; (* Bus scans for and maintains device list *)
- scsiBusScansOnInit* = $40; (* Bus scans performed at power-up/reboot *)
- scsiBusLoadsROMDrivers* = $20; (* may load ROM drivers to support targets *)
-
- (* scsiFeatureFlags field bits *)
- scsiBusInternalExternalMask* = $000000C0; (* bus internal/external mask *)
- scsiBusInternalExternalUnknown* = $00000000; (* not known whether bus is inside or outside *)
- scsiBusInternalExternal* = $000000C0; (* bus goes inside and outside the box *)
- scsiBusInternal* = $00000080; (* bus goes inside the box *)
- scsiBusExternal* = $00000040; (* bus goes outside the box *)
- scsiBusCacheCoherentDMA* = $00000020; (* DMA is cache coherent *)
- scsiBusOldCallCapable* = $00000010; (* SIM is old call capable *)
- scsiBusDifferential* = $00000004; (* Single Ended (0) or Differential (1) *)
- scsiBusFastSCSI* = $00000002; (* HBA supports fast SCSI *)
- scsiBusDMAavailable* = $00000001; (* DMA is available *)
-
- (* scsiWeirdStuff field bits *)
- scsiOddDisconnectUnsafeRead1* = $0001; (* Disconnects on odd byte boundries are unsafe with DMA and/or blind reads *)
- scsiOddDisconnectUnsafeWrite1* = $0002; (* Disconnects on odd byte boundries are unsafe with DMA and/or blind writes *)
- scsiBusErrorsUnsafe* = $0004; (* Non-handshaked delays or disconnects during blind transfers may cause a crash *)
- scsiRequiresHandshake* = $0008; (* Non-handshaked delays or disconnects during blind transfers may cause data corruption *)
- scsiTargetDrivenSDTRSafe* = $0010; (* Targets which initiate synchronous negotiations are supported *)
-
- (* scsiHBAslotType values *)
- scsiMotherboardBus* = $01; (* A built in Apple supplied bus *)
- scsiNuBus* = $02; (* A SIM on a NuBus card *)
- scsiPDSBus* = $03; (* " on a PDS card *)
- scsiPCIBus* = $04; (* " on a PCI bus card *)
- scsiPCMCIABus* = $05; (* " on a PCMCIA card *)
- scsiFireWireBridgeBus* = $06; (* " connected through a FireWire bridge *)
-
- (* Defines for the scsiDriverFlags field (in SCSIDriverPB) *)
- scsiDeviceSensitive* = $0001; (* Only driver should access this device *)
- scsiDeviceNoOldCallAccess* = $0002; (* no old call access to this device *)
-
- (* SIMInitInfo PB *)
- (* directions are for SCSIRegisterBus call ( -> parm, <- result) *)
-
- TYPE
- SIMInitInfo* = RECORD
- SIMstaticPtr*: SYSTEM.PTR (*ΔΔ POINTER TO UInt8*); (* <- alloc. ptr to the SIM's static vars *)
- staticSize*: LONGINT; (* -> num bytes SIM needs for static vars *)
- SIMInit*: SIMInitUPP; (* -> pointer to the SIM init routine *)
- SIMAction*: SIMActionUPP; (* -> pointer to the SIM action routine *)
- SIM_ISR*: SCSIInterruptUPP; (* reserved *)
- SIMInterruptPoll*: SCSIInterruptUPP; (* -> pointer to the SIM interrupt poll routine *)
- NewOldCall*: SIMActionUPP; (* -> pointer to the SIM NewOldCall routine *)
- ioPBSize*: Types.UInt16; (* -> size of SCSI_IO_PBs required for this SIM *)
- oldCallCapable*: BOOLEAN; (* -> true if this SIM can handle old-API calls *)
- simInfoUnused1*: Types.SInt8; (* UInt8 *) (* reserved *)
- simInternalUse*: LONGINT; (* xx not affected or viewed by XPT *)
- XPT_ISR*: SCSIUPP; (* reserved *)
- EnteringSIM*: SCSIUPP; (* <- ptr to the EnteringSIM routine *)
- ExitingSIM*: SCSIUPP; (* <- ptr to the ExitingSIM routine *)
- MakeCallback*: SCSIMakeCallbackUPP; (* <- the XPT layer’s SCSIMakeCallback routine *)
- busID*: Types.UInt16; (* <- bus number for the registered bus *)
- simInfoUnused3*: Types.UInt16; (* <- reserved *)
- simInfoUnused4*: LONGINT; (* <- reserved *)
- END;
-
- (* Glue between SCSI calls and SCSITrap format *)
-
- CONST
- xptSCSIAction* = $0001;
- xptSCSIRegisterBus* = $0002;
- xptSCSIDeregisterBus* = $0003;
- xptSCSIReregisterBus* = $0004;
- xptSCSIKillXPT* = $0005; (* kills Mini-XPT after transition *)
- xptSCSIInitialize* = $000A; (* Initialize the SCSI manager *)
-
- (* SCSI status*)
- scsiStatGood* = $00; (* Good Status*)
- scsiStatCheckCondition* = $02; (* Check Condition*)
- scsiStatConditionMet* = $04; (* Condition Met*)
- scsiStatBusy* = $08; (* Busy*)
- scsiStatIntermediate* = $10; (* Intermediate*)
- scsiStatIntermedMet* = $14; (* Intermediate - Condition Met*)
- scsiStatResvConflict* = $18; (* Reservation conflict*)
- scsiStatTerminated* = $20; (* Command terminated*)
- scsiStatQFull* = $28; (* Queue full*)
-
- (* SCSI messages*)
- kCmdCompleteMsg* = 0;
- kExtendedMsg* = 1; (* 0x01*)
- kSaveDataPointerMsg* = 2; (* 0x02*)
- kRestorePointersMsg* = 3; (* 0x03*)
- kDisconnectMsg* = 4; (* 0x04*)
- kInitiatorDetectedErrorMsg* = 5; (* 0x05*)
- kAbortMsg* = 6; (* 0x06*)
- kMsgRejectMsg* = 7; (* 0x07*)
- kNoOperationMsg* = 8; (* 0x08*)
- kMsgParityErrorMsg* = 9; (* 0x09*)
- kLinkedCmdCompleteMsg* = 10; (* 0x0a*)
- kLinkedCmdCompleteWithFlagMsg* = 11; (* 0x0b*)
- kBusDeviceResetMsg* = 12; (* 0x0c*)
- kAbortTagMsg* = 13; (* 0x0d*)
- kClearQueueMsg* = 14; (* 0x0e*)
- kInitiateRecoveryMsg* = 15; (* 0x0f*)
- kReleaseRecoveryMsg* = 16; (* 0x10*)
- kTerminateIOProcessMsg* = 17; (* 0x11*)
- kSimpleQueueTag* = $20; (* 0x20*)
- kHeadOfQueueTagMsg* = 33; (* 0x21*)
- kOrderedQueueTagMsg* = 34; (* 0x22*)
- kIgnoreWideResidueMsg* = 35; (* 0x23*)
-
- (* moveq #kSCSIx, D0; _SCSIAtomic *)
-
- PROCEDURE SCSIAction*(VAR parameterBlock: SCSI_PB): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $7001, $A089, $3E80;
- (*$END*)
- PROCEDURE SCSIRegisterBus*(VAR parameterBlock: SIMInitInfo): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $7002, $A089, $3E80;
- (*$END*)
- PROCEDURE SCSIDeregisterBus*(VAR parameterBlock: SCSI_PB): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $7003, $A089, $3E80;
- (*$END*)
- PROCEDURE SCSIReregisterBus*(VAR parameterBlock: SIMInitInfo): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $7004, $A089, $3E80;
- (*$END*)
- PROCEDURE SCSIKillXPT*(VAR parameterBlock: SIMInitInfo): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $7005, $A089, $3E80;
- (*$END*)
-
- (* $ALIGN RESET*)
- (* $POP*)
-
- END SCSI.
-